using System;
using System.Collections.Generic;

public static class RoundBasedGameModeProvider
{
	private static HashSet<IRoundBasedGameMode> _createdInstances = new HashSet<IRoundBasedGameMode>();

	public static IRoundBasedGameMode GetGameModeInstance(TypeGame gameType)
	{
		if (!GameModeProviderConfig.config.ContainsKey(gameType))
		{
			throw new InvalidOperationException("Не назначена конфигурация для типа игры " + gameType);
		}
		Type type = GameModeProviderConfig.config[gameType];
		IRoundBasedGameMode roundBasedGameMode = (IRoundBasedGameMode)Activator.CreateInstance(type);
		(roundBasedGameMode as DefaultGameMode).GameType = gameType;
		return roundBasedGameMode;
	}
}
